package trading_strategy;

import trading_strategy.events.EventListener;
import trading_strategy.events.ListenerSpecificEventDispatcher;

/**
 * Created by IntelliJ IDEA.
 * User: gderoujoux
 * Date: 6 mai 2010
 * Time: 10:23:14
 * To change this template use File | Settings | File Templates.
 */
public abstract class Strategy implements EventListener {
    public static enum Direction {
        BUY, SELL
    }
    
    boolean started = false;
    final ListenerSpecificEventDispatcher dispatcher = new ListenerSpecificEventDispatcher(this);

    public boolean isStarted() {
        return started;
    }

    public void start() {
        this.started = true;
    }

    public void stop() {
        this.started = false;
    }

    public ListenerSpecificEventDispatcher getEventDispatcher() {
        return dispatcher;
    }

    public EventListener getListener() {
        return dispatcher;
    }

    public abstract double getPnL();
}
